package com.xish.api.trade;


import com.xish.model.bean.WzmActivityTrade;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jdbc.query.QueryDslJdbcTemplate;
import org.springframework.stereotype.Repository;

import static com.xish.model.table.QWzmActivityTrade.wzmActivityTrade;

@Repository
public class TradeRepository {

    @Autowired
    private QueryDslJdbcTemplate jdbcTemplate;

    public WzmActivityTrade findByActivityId(int activityId) {
        return jdbcTemplate.queryForObject(jdbcTemplate.newSqlQuery()
                .from(wzmActivityTrade).where(wzmActivityTrade.activityId.eq(activityId)), wzmActivityTrade);
    }
}
